<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全国招聘</title>
    <link rel="stylesheet" href="/dev/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/dev/plugins/layui/layui/css/layui.css">
    <link rel="stylesheet" href="/dev/assets/css/geek-job/geek-city-css.css">
    <link rel="icon" href="/dev/assets/img/geek-job/wanli.jpg" type="image/x-icon">
</head>
<body>
<div id="nav-geek-job-city"></div>
<div id="wrap" class="page">
    <div class="page-job-wrapper" style="padding-top: 0px;">
        <div class="job-search-wrapper">

            <!-- 搜索框 -->
            <div class="job-search-box">
                <div class="job-search-form">
                    <span class="city-label">全国
                    <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                    </span>
                    <div class="search-input-box">
                        <input autocomplete="on" spellcheck="false" type="text" placeholder="搜索职位、公司" id="input">
                        <a href="#" class="search-map-btn">地图</a>
                        <a href="#" id="search-btn" class="search-btn">搜索</a>
                    </div>
                </div>
<!--                <a href="/dev/views/job/page/login.html" class="go-login-btn">登录,查看更多岗位</a>-->
            </div>


            <!-- 城市分栏 -->
            <div class="search-condition-wrapper">
                <div class="city-area-select">
                    <div class="city-area-current">
                        <i class="ui-icon-location"></i>
                        <span class="area-current-text">苏州</span>
                    </div>
                    <div class="city-area-dropdown">
                        <ul class="city-area-tab" style="padding-inline-start: 40px;">
                            <li class="active">专业和领域</li>
<!--                            <li class="subway">地铁</li>-->
                        </ul>
                        <div class="area-dropdown-item">
                            <ul class="dropdown-city-list" style="padding-inline-start: 40px;">
                                <li ka="sel-city" class="">互联网/IT/通信/电子</li>
                                <li ka="sel-city" class="">电子商务</li>
                                <li ka="sel-city" class="">医疗健康</li>
                                <li ka="sel-city" class="">生活服务</li>
                                <li ka="sel-city" class="">移动互联网</li>
                                <li ka="sel-city" class="">计算机服务</li>
                                <li ka="sel-city" class="">媒体</li>
                                <li ka="sel-city" class="">消费电子</li>
                                <li ka="sel-city" class="">智能硬件</li>
                                <li ka="sel-city" class="">计算机软件</li>
                                <li ka="sel-city" class="">运营商</li>
                                <li ka="sel-city" class="">新零售</li>
                                <li ka="sel-city" class="">旅游</li>
                                <li>其它分类</li>
                            </ul>
                        </div>

                        <div class="area-dropdown-item">
                            <div class="area-select-wrapper">
                                <div class="area-select-container">
                                    <ul class="dropdown-area-list" style="padding-inline-start: 40px;">
                                        <li>互联网</li>
                                        <li ka="sel-business-0" class="">测试工程师</li>
                                        <li ka="sel-business-1" class="">测试开发</li>
                                        <li ka="sel-business-2" class="">区块链工程师</li>
                                        <li ka="sel-business-3" class="">前端开发工程师</li>
                                        <li ka="sel-business-4" class="">C#</li>
                                        <li ka="sel-business-5" class="">GIS工程师</li>
                                        <li ka="sel-business-6" class="">U3D</li>
                                        <li ka="sel-business-7" class="">技术美术</li>
                                        <li ka="sel-business-8" class="">Cocos</li>
                                        <li ka="sel-business-8" class="">Android</li>
                                        <li ka="sel-business-8" class="">语音开发</li>
                                        <li ka="sel-business-8" class="">全栈工程师</li>
                                        <li ka="sel-business-9" class="">其他后端开发</li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="selectbox">
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">公司行业
                                <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">职位类型
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">求职类型
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">工作经验
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">薪资待遇
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">学历要求
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">公司规模
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <div class="condition-industry-select">
                        <div class="current-select">
                            <span class="placeholder-text">融资阶段
                            <img class="arrow_img" src="/dev/assets/img/geek-job/arrow.png">
                            </span>
                        </div>
                    </div>
                    <a href="javascript:;" class="clear-search-btn">清空筛选条件</a>
                </div>
            </div>
        </div>

        <div class="hidd" style="display: none;margin: 50px 650px;font-size: 16px">没有更多了</div>


        <!-- 发布职位分栏 -->
        <div class="page-job-inner">
            <div class="page-job-content clearfix">
                <div class="job-list-wrapper">
                    <div class="job-wrapper">
                        <h3>最多人看
<!--                            <a href="#" rel="nofollow" target="_blank">更多职位</a>-->
                        </h3>
                        <ul class="similar-job-list">
<!--                            <li>-->
<!--                                <a href="#" >-->
<!--                                    <div class="similar-job-info">-->
<!--                                        <span class="similar-job-name" >java工程师</span>-->
<!--                                        <span class="similar-job-salary" >12-20K</span>-->
<!--                                    </div>-->
<!--                                    <p class="similar-job-attr">-->
<!--                                        <span class="similar-job-company">-->
<!--                                            <span class="job-company-logo">-->
<!--                                                <img src="/dev/assets/img/h7.jpg">-->
<!--                                            </span>-->
<!--                                            <span class="similar-job-name" id="companyName1">高贤甫</span>-->
<!--                                        </span>-->
<!--                                        <span class="similar-job-location" id="workPlaces">苏州</span>-->
<!--                                    </p>-->
<!--                                </a>-->
<!--                            </li>-->

                        </ul>
<!--                        <a href="/dev/views/geek-job/geek-job-city.html" class="look-all" ka="more-similar-jobs1">查看全部职位</a>-->
                    </div>
                    <div id="wrapp">


                    </div>
                    <div class="search-job-result">

                    </div>
                </div>

                <!-- 侧边广告栏 -->
                <div class="job-side-wrapper">
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/dev/plugins/jquery/jquery.min.js"></script>
<script src="/dev/plugins/bootstrap/js/bootstrap.js"></script>
<script src="/dev/plugins/layui/layui/layui.js"></script>
<script  src="/dev/assets/js/geek-job/geek-job-city.js"></script>

<!-- 具体职位栏 -->
<script>
    // $(document).ready(function (){
    //     $('#nav-geek-job-city').load("/dev/views/common/nav.html")
    // })

    let Inpu = new URLSearchParams(window.location.search);
    var baseInput = Inpu.get('baseInput');
    if (baseInput != null || baseInput !== "") {
        $("#input").val(baseInput)
    }

    $(function (){

        $("#search-btn").click()
        $.ajax({
            headers: {
                "id": localStorage.getItem("id"),
                "token": localStorage.getItem("token")
            },
            type: 'get',
            // url: `/dev/Details/findAll`,
            url: `/dev/Ranking/limitPost`,
            async: false,
            success: function (result) {
                let selecter = document.querySelector(".similar-job-list")
                let str = ''
                for (let i = 0; i <= 4; i++) {
                    str += `<li>
                               <a href="#" class="job-card-left" onclick="conn(${result.data[i].id})">
                                    <div class="similar-job-info">
                                        <span class="similar-job-name" >${result.data[i].posName}</span>
                                        <span class="similar-job-salary" >${Math.round(result.data[i].payFloor / 1000) + "K" + "-" + Math.round(result.data[i].payUpper / 1000) + "K"}</span>
                                    </div>
                                    <p class="similar-job-attr">
                                        <span class="similar-job-company">
                                            <span class="job-company-logo">
<!--                                                <img src="${result.data[i].jrAvatar}">-->
                                            </span>
                                            <span class="similar-job-name">${result.data[i].recruitmentAgency}</span>
                                        </span>
                                        <span class="similar-job-location" >${result.data[i].workPlace}</span>
                                    </p>
                                </a>
                            </li>
<hr>`
                }
                selecter.innerHTML=str
            }})

    })


    $("#search-btn").click(function (){

        // reqs()
        $("#wrapp").empty();
        let input = document.getElementById("input").value

        if (input!==baseInput){
            window.location.href=`/dev/views/geek-job/geek-job-city.html?baseInput=${input}`
        }

        console.log("=input=")
        console.log(input)
        if (input==='') {
            layui.use(function () {
                var flow = layui.flow;
                // 流加载实例
                flow.load({
                    elem: '#wrapp', // 流加载容器
                    done: function (page, next) { // 执行下一页的回调
                        // 模拟数据插入
                        setTimeout(function () {
                            let inp = $("#input").val()
                            $.ajax({
                                headers: {
                                    "id": localStorage.getItem("id"),
                                    "token": localStorage.getItem("token")
                                },
                                url: `/dev/GeekJ/geekjob`,
                                data: {
                                    "jsId": localStorage.getItem("id"),
                                    "searchkey": inp
                                },
                                type: "get",
                                success: function (posts) {
                                    console.log(posts)
                                    var lis = [];
                                    let number = posts.data.length;
                                    let start = (page - 1) * 10;
                                    let end = Math.min(start + 10, posts.data.length)
                                    console.log(page)
                                    console.log(start)
                                    console.log(end)
                                    for (let i = start; i < end; i++) {
                                        lis.push(`<div class="job-list-box" >
                            <li class="job-card-wrapper">
                                <div class="job-card-body clearfix">
                                    <a href="#" class="job-card-left" onclick="conn(${posts.data[i].postId})">
                                        <div class="job-title clearfix">
                                            <span class="job-name">${posts.data[i].posName}</span>
                                            <span class="job-area-wrapper">
                                                    <span class="job-area">${posts.data[i].workPlace}
                                                </span>
                                        </div>
                                        <div class="job-info clearfix">
                                            <span class="salary">${Math.round(posts.data[i].payFloor / 1000)}-${Math.round(posts.data[i].payUpper / 1000)}K</span>
                                            <ul class="tag-list" style="padding-inline-start: 40px;"><li>${posts.data[i].ageDemand}</li>
                                                <li>${posts.data[i].specialty}</li>
                                            </ul>
                                            <div class="info-public"> ${posts.data[i].jrName}<em>${posts.data[i].jrType}</em></div>
                                            <!-- <a href="javascript:;" ka="cpc_job_list_chat_1" class="start-chat-btn">立即沟通</a> -->
                                        </div>
                                    </a>
                                    <div class="job-card-right" onclick="con(${posts.data[i].jrId});">
                                        <div class="company-logo">
                                            <a href="#">
                                                <img  src="${posts.data[i].jrAvatar}">
                                            </a>
                                        </div>
                                        <div class="company-info">
                                            <h3 class="company-name"><a href="#" target="_blank" >${posts.data[i].companyName}</a></h3>
                                            <ul class="company-tag-list" style="padding-inline-start: 40px;">
                                                <li>${posts.data[i].companyType}</li>
                                                <li>${posts.data[i].runState}</li>
                                                <li>${posts.data[i].employeesQuantity}</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div class="job-card-footer clearfix">
                                    <ul class="tag-list" style="max-width: 350px;white-space: nowrap;padding-inline-start: 10px;overflow: hidden;text-overflow: ellipsis;">
                                        ${posts.data[i].posDescription}
                                    </ul>
                                    <div class="info-desc">${posts.data[i].jobBenefits}</div>
                                </div>
                            </li>
                        </div>`)
                                    }
                                    next(lis.join(''), page < Math.round(number / 10));
                                }
                            })
                        }, 520);
                    }
                });
            });

        }else {
            console.log("abdhsj")

            layui.use(function(){
                var flow = layui.flow;
                // 流加载实例
                flow.load({
                    elem: '#wrapp', // 流加载容器
                    done: function(page, next){ // 执行下一页的回调
                        // 模拟数据插入
                        setTimeout(function(){
                            let inp = $("#input").val()
                            $.ajax({
                                headers:{
                                    "id":localStorage.getItem("id"),
                                    "token":localStorage.getItem("token")
                                },
                                url:`/dev/PostsSearch/search/${inp}}`,//?_=${Math.random()
                                type:"get",
                                success: function (posts) {
                                    if (posts.data == null || posts.data === []) {
                                        next("", false);

                                        return ;
                                    }
                                        console.log(posts)
                                        var lis = [];
                                        let number = posts.data.length;
                                        let start = (page - 1) * 10;
                                        let end = Math.min(start + 10, posts.data.length)
                                        console.log(page)
                                        console.log(start)
                                        console.log(end)



                                        for (let i = start; i < end; i++) {

                                            let runState = ""
                                            if (posts.data[i].content.runState == 0) {
                                                runState = "未上市"
                                            } else if (posts.data[i].content.runState == 1) {
                                                runState = "已上市"
                                            }
                                            lis.push(`<div class="job-list-box" >
                            <li class="job-card-wrapper">
                                <div class="job-card-body clearfix">
                                    <a href="#" class="job-card-left" onclick="conn(${posts.data[i].content.id})">
                                        <div class="job-title clearfix">
                                            <span class="job-name">${posts.data[i].highlightFields.posName == null ? posts.data[i].content.posName : posts.data[i].highlightFields.posName}</span>
                                            <span class="job-area-wrapper">
                                                    <span class="job-area">${posts.data[i].content.workPlace}
                                                </span>
                                        </div>
                                        <div class="job-info clearfix">
                                            <span class="salary">${Math.round(posts.data[i].content.payFloor / 1000)}-${Math.round(posts.data[i].content.payUpper / 1000)}K</span>
                                            <ul class="tag-list" style="padding-inline-start: 40px;"><li>${posts.data[i].content.ageDemand}</li>
                                                <li>${posts.data[i].content.specialty}</li>
                                            </ul>
                                            <div class="info-public"> ${posts.data[i].content.jrName}<em>${posts.data[i].content.jrType}</em></div>
                                            <!-- <a href="javascript:;" ka="cpc_job_list_chat_1" class="start-chat-btn">立即沟通</a> -->
                                        </div>
                                    </a>
                                    <div class="job-card-right" onclick="con(${posts.data[i].content.jrId});">
                                        <div class="company-logo">
                                            <a href="#">
                                                <img  src="${posts.data[i].content.jrAvatar}">
                                            </a>
                                        </div>
                                        <div class="company-info">
                                            <h3 class="company-name"><a href="#" target="_blank" >${posts.data[0].highlightFields.companyName == null ? posts.data[i].content.companyName : posts.data[i].highlightFields.companyName}</a></h3>

                                            <ul class="company-tag-list" style="padding-inline-start: 40px;">
                                                <li>${posts.data[i].content.companyType}</li>
                                                <li>${runState}</li>
                                                <li>${posts.data[i].content.employeesQuantity}</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div class="job-card-footer clearfix">
                                     <ul class="tag-list" style="max-width: 350px;white-space: nowrap;padding-inline-start: 10px;overflow: hidden;text-overflow: ellipsis;">
                                        ${posts.data[i].highlightFields.posDescription == null ? posts.data[i].content.posDescription : posts.data[i].highlightFields.posDescription}
                                    </ul>
                                    <div class="info-desc">${posts.data[i].content.jobBenefits}</div>
                                </div>
                            </li>
                        </div>`)
                                        }
                                        next(lis.join(''), page < Math.round(number / 10));
                                    // }
                                }
                            })
                        }, 520);
                    }
                });
            });
        }
    })

    function conn(num){
        // $.ajax({
        //     headers:{
        //         "id":localStorage.getItem("id"),
        //         "token":localStorage.getItem("token")
        //     },
        //     url:`/dev/Ranking/hits/${num}`,
        //     type:"get",
        //     success: function (result) {
        //             console.log("添加成功")
        //         }
        //     })

        window.location=`/dev/views/job/page/boss.html?posId=${num}`;
    }

    function con(nums){
        // localStorage.setItem("postId",num);
        window.location=`/dev/views/job/page/jobdetails.html?jrId=${nums}`;
    }


<!--侧边广告栏-->

    // $(function (){
        // $.ajax({
        //     headers:{
        //         "id":localStorage.getItem("id"),
        //         "token":localStorage.getItem("token")
        //     },
        //     url: `/dev/GeekJ/sameCompanyJob`,
        //     type: "get",
        //     data: {
        //         "companyName":"砌墙集团"
        //     },
        //     success: function (samejobs) {
        //         let str = ``;
        //         str += `<div class="side-banner-wrapper">
        //                 <!-- 公司信息 -->
        //                 <a class="company-info-top" href="#" target="_blank">
        //                     <div class="company-img">
        //                         <img src="/dev/assets/img/geek-job/dog.jpg" data-src="" alt="">
        //                     </div>
        //                     <div class="company-info">
        //                         <h3>${samejobs.data[0].companyName}</h3>
        //                         <p>${samejobs.data[0].runState}<span class="vline"></span>${samejobs.data[0].EmployeesQuantity}<span class="vline"></span>${samejobs.data[0].companyType}</p>
        //                     </div>
        //                 </a>
        //                 <!-- 职位列表 -->
        //
        //          <ul class="company-job-list" style="padding-inline-start: 40px;">`;
        //         for (let i = 0; i < 3; i++) {
        //             str += `<li class="company-job-item">
        //                         <a href="#" class="job-info" target="_blank">
        //                             <div class="job-info-top">
        //                                 <p class="name">${samejobs.data[i].posName}</p>
        //                                 <div class="guide-app-download-icon" data-securityid="EGGpXGeG9O88v-_1FyhX2_0QzNnFgxaaIgHGbyySxqi_xjKScH8l5oDRWCKyDsMYJfFvW5LD6CxqS2Z_OfwxFJuwz3A~" data-bossid="4b856b64a92524c40nJ63dy0GVU~" data-isfriend="false"></div>
        //                                 <p class="salary">5-8K</p>
        //                             </div>
        //                             <p class="job-text"><span>${samejobs.data[i].workPlace}</span><span>${samejobs.data[i].ageDemand}</span><span>${samejobs.data[i].specialty}</span></p>
        //                         </a>
        //                     </li>`
        //         }
        //         str += `</ul>
        //                 <a href="#" target="_blank" class="more-job-btn">查看更多职位</a>
        //             </div>`;
        //
        //         document.getElementsByClassName("job-side-wrapper")[0].innerHTML = str
        //     }
        // })




    // })
</script>
</body>
</html>